#!/bin/bash 
# 
# 安装wangmarket及插件
#
cd /readyFile
echo '下载部署最新的wangmarket安装包'
wget $wangmarketDownUrl -O wangmarket.zip
cp wangmarket.zip /mnt/tomcat8/webapps/ROOT/wangmarket.zip
cd /mnt/tomcat8/webapps/ROOT/
unzip wangmarket.zip
rm -rf wangmarket.zip

sleep 3
#
#
# 安装一些插件
#
cd /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/
# 安装数据库自动备份插件
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.databaseAutoBackups-*.jar
wget $plugin_databaseAutoBackups
# 安装后台开放API
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.adminapi-*.jar
wget $plugin_adminapi
# 关键词替换插件
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.keyword-*.jar
wget $plugin_keyword
# 网站分离插件
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.htmlSeparate-*.jar
wget $plugin_htmlSeparate
# 网站分离-ftp推送功能，需要这个包实现ftp传输
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/commons-net-*.jar
wget http://down.zvo.cn/wangmarket/version/v5.7/commons-net-3.3.jar
# 万能表单插件
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.form-*.jar
wget $plugin_form
# sitemap
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.sitemap-*.jar
wget $plugin_sitemap
# 文件管理
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.fileManager-*.jar
wget $plugin_fileManager
# OEM
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.oem-*.jar
wget $plugin_oem
# 安装网站开放API
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.siteapi-*.jar
wget $plugin_siteapi
# 子账号
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.siteSubAccount-*.jar
wget $plugin_siteSubAccount
# 文章同步插件
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.newsSync-*.jar
wget $plugin_newsSync
# controller请求日志
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.controllerRequestLog-*.jar
wget $plugin_controllerRequestLog
# 私有模板库
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.templateCenter-*.jar
wget $plugin_templateCenter
# 网站转移
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.siteTransfer-*.jar
wget $plugin_siteTransfer
# robots.txt编辑
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.robots-*.jar
wget $plugin_robots
# 手机号创建网站
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.phoneCreateSite-*.jar
wget $plugin_phoneCreateSite
# 版本更新
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.upgrade-*.jar
wget $plugin_upgrade
# 华为云服务自动创建，主要是OBS
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.huaWeiYunServiceCreate-*.jar
wget $plugin_huaWeiYunServiceCreate
# 多域名绑定
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.moreDomain-*.jar
wget $plugin_moreDomain
# 国际化
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.translate-*.jar
wget $plugin_translate
# 在线客服
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.kefu-*.jar
wget $plugin_kefu
# 在线客服的模板
mkdir /mnt/tomcat8/webapps/ROOT/WEB-INF/classes/static/plugin/kefu/template/ -p
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/classes/static/plugin/kefu/template/*
cd /mnt/tomcat8/webapps/ROOT/WEB-INF/classes/static/plugin/kefu/template/
wget http://down.zvo.cn/wangmarket/plugin/kefu/template_v1.0.zip -O template.zip
yum -y install unzip
unzip template.zip
rm -rf template.zip
# seo
rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.seo-*.jar
wget $plugin_seo
# dataDictionary 数据字典
# v6.4放开
#rm -rf /mnt/tomcat8/webapps/ROOT/WEB-INF/lib/wangmarket.plugin.dataDictionary-*.jar
#wget $plugin_dataDictionary

echo 'wangmarket及相关插件安装完毕'